<img src='partials/TestStackedChart3.PNG' style='width:400px;float:right'>
<div>
<pre>
<span class='code_snippet' style='font-size: 11px'>

// x-Axis needs to be shared
XAxis xAxis = new XAxis(new LinearNumericalAxisScaling(), "X");
xAxis.axisScaling.setMinValue(0);
xAxis.axisScaling.setMaxValue(100);

XYChart topChart = (XYChart) new TestDataBar_5_PosNegColor().getChart();
topChart.xAxis = xAxis;

XYChart bottomChart = (XYChart) new TestDataXY_SineCurve().getChart();
bottomChart.xAxis = xAxis;

XYChart middleChart = (XYChart) new TestDataXY_Scatter().getChart();
middleChart.xAxis = xAxis;

ArrayList&lt;XYChart&gt; charts = new ArrayList&lt;XYChart&gt;();
charts.add(topChart);
charts.add(middleChart);
charts.add(bottomChart);

// height percentages
ArrayList&lt;Integer&gt; percentages = new ArrayList&lt;Integer&gt;();
percentages.add(40);
percentages.add(30);
percentages.add(30);

StackedXYChart chart = new StackedXYChart(
"Three random charts with same X Axis", charts, percentages);

</span></pre></div>